<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>03-js作业-螺旋</title>
  <style>
	html{font-family: "Microsoft YaHei";}
	body{margin: 0;}
	#wrap{
		position: relative;
		margin: 50px auto;
		width: 500px;
		cursor: pointer;
		}
	.box1 img{
		width: 100%;
		vertical-align: top;
	}
	.box2{
		display: none;
		position: absolute;
		bottom: 0;
		width: 100%;
		height: 100px;
		background-color: rgba(0,0,0,.5);
		font-size: 50px;
		font-weight: 700;
		line-height: 100px;
		color: #fff;
		text-align: center;
	}
	.dp-b{
		display: block;
	}
  </style>
 <body>
	<section id="wrap">
		<div class="box1"><img src="images/mgsv.jpg" alt="mgsv"></div>
		<div id="box2" class="box2">《合金装备5：幻痛》</div>
	</section>
 </body>
 <script>
	var a = document.getElementById('wrap');
	var b = document.getElementById('box2');
	a.onmouseenter = function(){
		b.className = 'box2 dp-b';
	};
	a.onmouseleave = function(){
		b.className = 'box2';
	};
 </script>
</html>